home *** CD-ROM | disk | FTP | other *** search
- #
- # a DrawnButton
- #
- # for this, we have to do Xlib-style drawing ourselves, which
- # should only be done in exposeCallback, and for which we need
- # graphics contexts.
-
- xmDrawnButton .btn managed
- .btn exposeCallback show_text
- set gc1 [.btn getGC -foreground yellow -background green]
- set gc2 [.btn getGC -foreground blue -background pink]
-
- proc show_text {} {
- global gc1
- global gc2
-
- .btn drawImageString $gc1 30 30 "hello"
- .btn drawImageString $gc2 30 80 "world"
- }
-
-